package com.dahuyou.write.jvm.version;

public class Main {

    public static void main(String[] args) {
        Cmd cmd = Cmd.parse(args);
        if (!cmd.ok || cmd.helpFlag) {
            System.out.println("Usage: <main class> [-options] class [args...]");
            return;
        }
        if (cmd.versionFlag) {
            System.out.println("java version \"9(mine)\"\n" +
                    "Java(TM) SE Runtime Environment (build 9+181)\n" +
                    "Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)");
            return;
        }
        startJVM(cmd);
        System.out.println("xxxxxxxxxxxxx");
    }

    private static void startJVM(Cmd cmd) {
        System.out.printf("classpath:%s class:%s args:%s\n", cmd.classpath, cmd.getMainClass(), cmd.getAppArgs());
    }

}
